<?php

class Xmlgrid extends Grid {

	protected $fields;
	protected $template = 'xml_responce';
	protected $page = 1;
	protected $total = 0;

	public function __construct($base_uri, $template = FALSE)
	{

		if ($template) {
			$this->template = $template;
		}
		$this->template = new View($this->template);
		$this->template->base_uri = $this->base_uri = $base_uri;
	}

	public function add_new_button()
	{
		return TRUE;

	}

	public function render()
	{
		$this->template->fields = $this->fields;
		$this->template->page = $this->page;
		$this->template->total = $this->total;

		return $this->template->render();
	}

	public function __toString()
	{
	    ajax::xml_header();
		return $this->render();
	}
}
